#include "brepFeature.h"

BrepFeature::BrepFeature()
{
    //初始值全设置成-1
    brepId = -1;
    featureType = 6;
    resultId = -1;
    toolFeature = nullptr;
    targetFeature = nullptr;
}

BrepFeature::~BrepFeature()
{
}

int BrepFeature::getBrepId()
{
    return brepId;
}

int BrepFeature::getBrepType()
{
    return brepType;
}

int BrepFeature::getResultId()
{
    return resultId;
}

BaseFeature* BrepFeature::getToolFeature()
{
    return toolFeature;
}

BaseFeature* BrepFeature::getTargetFeature()
{
    return targetFeature;
}

void BrepFeature::setBrepId(int brepId)
{
    this->brepId = brepId;
}

void BrepFeature::setBrepType(int brepType)
{
    this->brepType = brepType;
}

void BrepFeature::setResultId(int resultId)
{
    this->resultId = resultId;
}

void BrepFeature::setToolFeature(BaseFeature* toolFeature)
{
    this->toolFeature = toolFeature;
}

void BrepFeature::setTargetFeature(BaseFeature* targetFeature)
{
    this->targetFeature = targetFeature;
}

void BrepFeature::AddOperation(BaseFeature* feature)
{
    if (this->targetFeature->getFeatureType() <= 5) {
        this->targetFeature->AddOperationToList(feature);
    }
    else {
        this->targetFeature->AddOperation(feature);
    }

    if (this->toolFeature->getFeatureType() <= 5) {
        this->toolFeature->AddOperationToList(feature);
    }
    else {
        this->toolFeature->AddOperation(feature);
    }
}
